package com.goldcontrol.cloudweb.quartz.job;

import com.goldcontrol.cloudweb.weixin.service.WeixinServiceApi;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

public class WeatherJob implements Job {

    private Logger logger = LoggerFactory.getLogger(WeatherJob.class);

    @Autowired
    WeixinServiceApi weixinServiceApi;

    @Override
    public void execute(JobExecutionContext jobExecutionContext){
        try{
            weixinServiceApi.autoRefreshWeather();
            logger.info("---------定时刷新天气---------");
        }catch (Exception e){
            logger.error("定时刷新天气失败",e);
        }
    }

}
